<?php

/**
 *  数据统计
 *
 * @author Administrator
 */

namespace Operation\Controller;

use Think\Controller;
use Think\IFilter;
use Think\IReq;

class ChartController extends ComController {

    public function index() {
        
       $this->display();
    }

    function chart_erweima() {
        ob_clean();
        vendor('Jpgraph.Chart');
        $chart = new \Chart;
        $title = "柱状图"; //标题
        $data = array(20, 27, 45, 75, 90, 10, 80, 100); //数据
        $size = 140; //尺寸
        $width = 750; //宽度
        $height = 350; //高度
        $legend = array("aaaa ", "bbbb", "cccc", "dddd ", "eeee ", "ffff ", "gggg ", "hhhh "); //说明
        $chart->creatBar($title, $data, $size, $height, $width, $legend);
    }
    public function chart(){
        ob_clean();
        vendor('Jpgraph.Chart');
        $chart = new \Chart;

        $title = '3D饼图'; //标题
        $data = array(20, 27, 45, 75, 90, 10, 20, 40); //数据
        $size = 140; //尺寸
        $width = 800; //宽度
        $height = 500; //高度
        $legend = array('aaaa ', 'bbbb', 'cccc', 'dddd ', 'eeee ', 'ffff ', 'gggg ', 'hhhh '); //说明
        
        $chart->create3dpie($title, $data, $size, $height, $width, $legend);
    }
}

